package com.study.system.course.controller;

import com.study.system.course.service.CourseOrientationService;
import com.study.system.entity.CourseOrientation;
import jakarta.annotation.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CourseOrientationController {

    @Resource
    private CourseOrientationService service;

    @RequestMapping("/course-orientations")
    public ResponseEntity<List<CourseOrientation>> getParentCourseOrientations(){
        return ResponseEntity.ok(service.getParentCourseOrientations());
    }

    @RequestMapping("/course-orientations/{parentId}")
    public ResponseEntity<List<CourseOrientation>> getCourseOrientationsByParentId(@PathVariable Integer parentId){
        return ResponseEntity.ok(service.getCourseOrientationsByParentId(parentId));
    }
}
